convert base64 to bitmap android

84

convert base64 to bitmap android -

byte[] decodedString = Base64.decode(encodedImage, Base64.DEFAULT);
Bitmap decodedByte = BitmapFactory.decodeByteArray(decodedString, 0, decodedString.length); 

Android Bitmap to Base64 String -

String encoded = Base64.encodeToString(byteArray, Base64.DEFAULT);

Android Bitmap to Base64 String -

ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();  
bitmap.compress(Bitmap.CompressFormat.PNG, 100, byteArrayOutputStream);
byte[] byteArray = byteArrayOutputStream .toByteArray();

Comments

Submit
0 Comments